function loadMdTournament(idCanvas) {

	var TM_Font1 = 'bold 14px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TM_Font2 = 'bold 20px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TM_Font3 = 'bold 11px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TM_FontRtn = 'bold 28px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TM_SchoolTxt = '';
	var TM_SexTxt = '';
	var TM_TypeTxt = '';

	jc.start(idCanvas, true);

	// 全国大会ボタン
//	jc.rect(30, 50, 230, 50, 'rgba(256,153,0)', 1).shadow({
	jc.rect(30, 50, 230, 50, 'rgba(180,180,180)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id("TM_B_KJ1").mouseover(function() {
//		jc('#TM_KJ1').color('#ffff00');
	}).mouseout(function() {
//		jc('#TM_KJ1').color('rgb(0,0,0)');
	}).click(function() {
//		jc.canvas(idCanvas).clear();
//		loadMdMenu(idCanvas);
	}).layer('TM_L_1');

	// 全国大会
	jc.text("全　国　大　会", 145, 85, 'rgb(0,0,0)').id('TM_KJ1').font(TM_FontRtn).align('center').mouseover(function() {
//		jc('#TM_KJ1').color('#ffff00');
	}).mouseout(function() {
//		jc('#TM_KJ1').color('rgb(0,0,0)');
	}).layer('TM_L_1');

	// 校内予選ボタン
	jc.rect(30, 150, 230, 50, 'rgba(256,153,0)', 1).shadow({
//	jc.rect(30, 150, 230, 50, 'rgba(180,180,180)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id("TM_B_KJ2").mouseover(function() {
		jc('#TM_KJ2').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_KJ2').color('rgb(0,0,0)');
	}).click(function() {
		var TM_2d = new Date();
		$.getJSON('../main/mdFieldStart' + '?_=' + TM_2d.getMilliseconds(), {
			userId : userId,
			eneId : '',
			eneLv : '',
			idCanvas : idCanvas
		}, callbackSchoolTrnmnt, 'json');
//		var TM_2d = new Date();
//		$.getJSON('../main/mdEditStart' + '?_=' + TM_2d.getMilliseconds(), {
//			userId : userId,
//			firstLogin : firstLogin,
//			idCanvas : idCanvas
//		}, callbackTrueField, "json");
	}).layer('TM_L_2');

	// 校内予選
	jc.text("校　内　予　選", 145, 185, 'rgb(0,0,0)').id('TM_KJ2').font(TM_FontRtn).align('center').mouseover(function() {
		jc('#TM_KJ2').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_KJ2').color('rgb(0,0,0)');
	}).layer('TM_L_2');


	// 乱戦ボタン
	jc.rect(30, 250, 230, 50, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id("TM_B_KJRnd").mouseover(function() {
		jc('#TM_KJRnd').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_KJRnd').color('rgb(0,0,0)');
	}).click(function() {
		var TM_3d = new Date();
		$.getJSON('../main/mdEnemySelect' + '?_=' + TM_3d.getMilliseconds(), {
			userId : userId,
			idCanvas : idCanvas
		}, callbackRansen, "json");
	}).layer('TM_L_3');

	// 乱戦
	jc.text("乱　戦", 145, 285, 'rgb(0,0,0)').id('TM_KJRnd').font(TM_FontRtn).align('center').layer('TM_L_3');

	jc.layer('TM_L_3').objects().mouseover(function() {
		jc('#TM_KJRnd').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_KJRnd').color('rgb(0,0,0)');
	});

	// メニューへ戻るボタン
	jc.rect(85, 380, 120, 30, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id("TM_B_RMenu").mouseover(function() {
		jc('#TM_rtnMenu').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_rtnMenu').color('rgb(0,0,0)');
	}).click(function() {
		jc.canvas(idCanvas).clear();
		loadMdMenu(idCanvas);
	}).layer('TM_L_5');

	// 個人記録へ戻る
	jc.text("戻　る", 145, 405, 'rgb(0,0,0)').id('TM_rtnMenu').font(TM_FontRtn).align('center').layer('TM_L_5');

	jc.layer('TM_L_5').objects().mouseover(function() {
		jc('#TM_rtnMenu').color('#ffff00');
	}).mouseout(function() {
		jc('#TM_rtnMenu').color('rgb(0,0,0)');
	});

}
function callbackRansen(result) {
	if (result.idCanvas != '') {
		userId = result.userId;
		enemyMntCG1 = result.enemyMntCG1;
		enemyMntId1 = result.enemyMntId1;
		enemyMntNm1 = result.enemyMntNm1;
		enemyMntScNm1 = getSchoolName(result.enemyMntScNm1);
		enemyMntLv1 = result.enemyMntLv1;
		enemyMntStr1 = result.enemyMntStr1;
		enemyMntCG2 = result.enemyMntCG2;
		enemyMntId2 = result.enemyMntId2;
		enemyMntNm2 = result.enemyMntNm2;
		enemyMntScNm2 = getSchoolName(result.enemyMntScNm2);
		enemyMntLv2 = result.enemyMntLv2;
		enemyMntStr2 = result.enemyMntStr2;
		enemyMntCG3 = result.enemyMntCG3;
		enemyMntId3 = result.enemyMntId3;
		enemyMntNm3 = result.enemyMntNm3;
		enemyMntScNm3 = getSchoolName(result.enemyMntScNm3);
		enemyMntLv3 = result.enemyMntLv3;
		enemyMntStr3 = result.enemyMntStr3;
		enemyMntCG4 = result.enemyMntCG4;
		enemyMntId4 = result.enemyMntId4;
		enemyMntNm4 = result.enemyMntNm4;
		enemyMntScNm4 = getSchoolName(result.enemyMntScNm4);
		enemyMntLv4 = result.enemyMntLv4;
		enemyMntStr4 = result.enemyMntStr4;

		jc.canvas(result.idCanvas).clear();
		loadMdRansen(result.idCanvas);
	}
}
function getSchoolName(schoolId){
	if(schoolId == '001'){
		return 'いなほ学園';
	} else if(schoolId == '002'){
		return 'かえで学院';
	} else if(schoolId == '003'){
		return 'あさぎ付属';
	} else if(schoolId == '004'){
		return 'もえぎ高校';
	}
	return '';
}
function callbackSchoolTrnmnt(result) {
	if (result.idCanvas != '') {
		userId = result.userId;
		playerName = result.playerName;
		playerSchool = result.playerSchool;
		playerSex = result.playerSex;
		playerType = result.playerType;
		playerBarPoint = result.playerBarPoint;
		playerBarPointBefore = result.playerBarPointBefore;
		playerAttackPoint = result.playerAttackPoint;
		playerKanji01 = result.playerKanji01;
		playerKanji02 = result.playerKanji02;
		playerKanji03 = result.playerKanji03;
		PF_S1 = parseInt(result.playerTypeSp1);
		PF_S2 = parseInt(result.playerTypeSp2);
		PF_S3 = parseInt(result.playerTypeSp3);
		PF_S4 = parseInt(result.playerTypeSp4);
		PF_S5 = parseInt(result.playerTypeSp5);
		playerCG = result.playerCG;
		userLevel = parseInt(result.userLevel);
		userExp = parseInt(result.userExp);
		userNextLvExp = parseInt(result.userNextLvExp);

		eneId = result.eneId;
		enemyName = result.enemyName;
		enemyBarPoint = result.enemyBarPoint;
		enemyBarPointBefore = result.enemyBarPointBefore;
		enemyAttackPoint = result.enemyAttackPoint;
		enemyKanji01 = result.enemyKanji01;
		enemyKanji02 = result.enemyKanji02;
		enemyKanji03 = result.enemyKanji03;
		EF_S1 = parseInt(result.enemyTypeSp1);
		EF_S2 = parseInt(result.enemyTypeSp2);
		EF_S3 = parseInt(result.enemyTypeSp3);
		EF_S4 = parseInt(result.enemyTypeSp4);
		EF_S5 = parseInt(result.enemyTypeSp5);
		enemyCG = result.enemyCG;
		enemyType = result.enemyType;

		jc.canvas(result.idCanvas).clear();
		loadMdSchoolTrnmnt(result.idCanvas);
		// タイトルの変更
		document.getElementById("headerText").innerHTML = "<b>対戦室</b>";
	}
}
//function callbackTrueField(result) {
//
//	if (result.idCanvas != '') {
//		userId = result.userId;
//		hdTxt01 = result.holderKanji01;
//		hdTxt02 = result.holderKanji02;
//		hdTxt03 = result.holderKanji03;
//		hdTxt04 = result.holderKanji04;
//		hdTxt05 = result.holderKanji05;
//		hdTxt06 = result.holderKanji06;
//		hdTxt07 = result.holderKanji07;
//		hdTxt08 = result.holderKanji08;
//		useTxt01 = result.usingKanji01;
//		useTxt02 = result.usingKanji02;
//		useTxt03 = result.usingKanji03;
//		useType01 = result.usingKanjiType01;
//		useType02 = result.usingKanjiType02;
//		useType03 = result.usingKanjiType03;
//		useTypeTxt01 = result.usingKanjiTypeText01;
//		useTypeTxt02 = result.usingKanjiTypeText02;
//		useTypeTxt03 = result.usingKanjiTypeText03;
//		userBP = parseInt(result.userBP);
//		userAP = parseInt(result.userAP);
//
//		if (result.kanji01Bp != "") {
//			kanji01Bp = parseInt(result.kanji01Bp);
//		} else {
//			kanji01Bp = 0;
//		}
//		if (result.kanji02Bp != "") {
//			kanji02Bp = parseInt(result.kanji02Bp);
//		} else {
//			kanji02Bp = 0;
//		}
//		if (result.kanji03Bp != "") {
//			kanji03Bp = parseInt(result.kanji03Bp);
//		} else {
//			kanji03Bp = 0;
//		}
//		if (result.kanji04Bp != "") {
//			kanji04Bp = parseInt(result.kanji04Bp);
//		} else {
//			kanji04Bp = 0;
//		}
//		if (result.kanji05Bp != "") {
//			kanji05Bp = parseInt(result.kanji05Bp);
//		} else {
//			kanji05Bp = 0;
//		}
//		if (result.kanji06Bp != "") {
//			kanji06Bp = parseInt(result.kanji06Bp);
//		} else {
//			kanji06Bp = 0;
//		}
//		if (result.kanji07Bp != "") {
//			kanji07Bp = parseInt(result.kanji07Bp);
//		} else {
//			kanji07Bp = 0;
//		}
//		if (result.kanji08Bp != "") {
//			kanji08Bp = parseInt(result.kanji08Bp);
//		} else {
//			kanji08Bp = 0;
//		}
//
//		if (result.kanji01Ap != "") {
//			kanji01Ap = parseInt(result.kanji01Ap);
//		} else {
//			kanji01Ap = 0;
//		}
//		if (result.kanji02Ap != "") {
//			kanji02Ap = parseInt(result.kanji02Ap);
//		} else {
//			kanji02Ap = 0;
//		}
//		if (result.kanji03Ap != "") {
//			kanji03Ap = parseInt(result.kanji03Ap);
//		} else {
//			kanji03Ap = 0;
//		}
//		if (result.kanji04Ap != "") {
//			kanji04Ap = parseInt(result.kanji04Ap);
//		} else {
//			kanji04Ap = 0;
//		}
//		if (result.kanji05Ap != "") {
//			kanji05Ap = parseInt(result.kanji05Ap);
//		} else {
//			kanji05Ap = 0;
//		}
//		if (result.kanji06Ap != "") {
//			kanji06Ap = parseInt(result.kanji06Ap);
//		} else {
//			kanji06Ap = 0;
//		}
//		if (result.kanji07Ap != "") {
//			kanji07Ap = parseInt(result.kanji07Ap);
//		} else {
//			kanji07Ap = 0;
//		}
//		if (result.kanji08Ap != "") {
//			kanji08Ap = parseInt(result.kanji08Ap);
//		} else {
//			kanji08Ap = 0;
//		}
//
//		kanji01Type = result.kanji01Type;
//		kanji02Type = result.kanji02Type;
//		kanji03Type = result.kanji03Type;
//		kanji04Type = result.kanji04Type;
//		kanji05Type = result.kanji05Type;
//		kanji06Type = result.kanji06Type;
//		kanji07Type = result.kanji07Type;
//		kanji08Type = result.kanji08Type;
//
//		kanji01TypeTxt = result.kanji01TypeTxt;
//		kanji02TypeTxt = result.kanji02TypeTxt;
//		kanji03TypeTxt = result.kanji03TypeTxt;
//		kanji04TypeTxt = result.kanji04TypeTxt;
//		kanji05TypeTxt = result.kanji05TypeTxt;
//		kanji06TypeTxt = result.kanji06TypeTxt;
//		kanji07TypeTxt = result.kanji07TypeTxt;
//		kanji08TypeTxt = result.kanji08TypeTxt;
//
//		PF_S1 = parseInt(result.playerTypeSp1);
//		PF_S2 = parseInt(result.playerTypeSp2);
//		PF_S3 = parseInt(result.playerTypeSp3);
//		PF_S4 = parseInt(result.playerTypeSp4);
//		PF_S5 = parseInt(result.playerTypeSp5);
//
//		firstLogin = result.firstLogin;
//
//		jc.canvas(result.idCanvas).clear();
//		loadMdTrueField(result.idCanvas);
//
//		// タイトルの変更
//		document.getElementById("headerText").innerHTML = "<b>対戦室</b>";
//	}
//}
